$(function () {
	function msg(){
		// 待我审批
		$.getJSON('/eova/api/myMsg?type=1&status=0', function(o){
			var num = o.length;
			if (num > 0) {
				$('dd[data-name="eova_flow_appro"]>a').append(`<span class="layui-badge">${num}</span>`);
			}
		});
		// 抄送我的
		$.getJSON('/eova/api/myMsg?type=2&status=0', function(o){
			var num = o.length;
			if (num > 0) {
				$('dd[data-name="eova_flow_notice"]>a').append(`<span class="layui-badge">${num}</span>`);
			}
		});
	}
	
	msg();
	
	setInterval(function() {
		msg();
	}, 20 * 1000)
	
});